package com.zym.init.core.annotation;

import com.zym.init.core.validator.FutureOrPresentDateValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * 验证时间是否是未来或当前日期
 * @author zym
 */
@Documented
@Constraint(validatedBy = FutureOrPresentDateValidator.class)
@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface FutureOrPresentDate {
    // 消息
    String message() default "时间必须是未来或当前日期";
    // 分组
    Class<?>[] groups() default {};
    // 负载
    Class<? extends Payload>[] payload() default {};
}